home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Demo / DesktopX / objects / ktekdockv1.dxpack / {3C36DAF7-9F4D-42F3-B199-AD6BB649A3B2}.DXScript2 < prev    next >
Extensible Markup Language  |  2004-08-24  |  3KB  |  76 lines

  1. <?xml version="1.0"?>
  2. <!--DXScript Data File.  Version 2.0-->
  3. <DXScript>
  4.     <Script><![CDATA[Dim mynum
  5. Dim tuning
  6. Dim url
  7. Dim station
  8. 'Called when the script is executed
  9. Sub Object_OnScriptEnter
  10.     mynum=right(object.Name,len(object.Name)-12)'12
  11. End Sub
  12.  
  13. Function Object_OnLButtonDown(x, y)
  14.     DesktopX.Object("shortcutcaption"&mynum).move DesktopX.Object("shortcutcaption"&mynum).left+1,7
  15.     tuning=False
  16.     object.SetTimer 1000,2000
  17.     
  18. End Function
  19.  
  20. Function Object_OnLButtonUp(x, y, Dragged)
  21.     DesktopX.Object("shortcutcaption"&mynum).move DesktopX.Object("shortcutcaption"&mynum).left-1,6
  22.     object.KillTimer 1000
  23.     If tuning=False And Dragged=False Then
  24.         desktopx.ScriptObject("kbarpin").launchshortcut(mynum)
  25.     End If
  26. End Function
  27.  
  28. Sub Object_OnTimer1000'sub called if button held for 2 seconds
  29.     object.KillTimer 1000
  30.     tuning=True
  31.     m=msgbox("Program/document shortcut or URL?"&Chr(13)&"Press YES for program/document or NO for URL",vbYesNo + vbQuestion,"K-Dock")
  32.     If m=vbYes Then
  33.         oldpath=object.LocalStorage("p")
  34.         If oldpath="" Then oldpath="C:\"
  35.         Set objFSO = CreateObject("Scripting.FileSystemObject")
  36.         newpath = System.FileOpenDialog("Select file...", "", oldpath , "Program files|*.exe|All files|*.*", 0)
  37.         If newpath="" Then
  38.             Exit Sub
  39.         End If
  40.         Set objFile=objFSO.GetFile(newpath)
  41.         n=objFile.Name
  42.     Else
  43.         newpath=InputBox("Enter the URL","K-Dock")
  44.         If newpath="" Then
  45.             Exit Sub
  46.         End If
  47.         n1=instr(newpath,"www.")
  48.         If n1>0 Then 
  49.             n1=n1+4
  50.             n=mid(newpath,n1,n1+20)
  51.         Else
  52.             n="my url"
  53.         End If
  54.     End If
  55.     Do
  56.         newcaption=InputBox("Enter the caption for your shortcut"&Chr(13)&"(20 characters or less)","K-Dock",n)
  57.     Loop Until Len(newcaption)<=20
  58.     If newcaption="" Then
  59.         Exit Sub
  60.     End If
  61.     desktopx.ScriptObject("kbarpin").redefineshortcut mynum,newpath,newcaption
  62. End Sub
  63.  
  64. Sub Object_OnMouseEnter
  65.     'station=desktopx.Object("kradiostation"&mynum).text
  66.     'DesktopX.ScriptObject("kradiotip").tooltip(station)
  67. End Sub
  68. Sub Object_OnMouseLeave
  69.     'DesktopX.ScriptObject("kradiotip").tooltip("hide")
  70. End Sub
  71. 'Called when the script is terminated
  72. Sub Object_OnScriptExit
  73.  
  74. End Sub
  75. ]]></Script><Globals><Editor><PropPane>0</PropPane><EditorLeft>222</EditorLeft><EditorTop>7</EditorTop><EditorRight>1230</EditorRight><EditorBottom>881</EditorBottom></Editor><Object><LanguageCLSID>{B54F3741-5B07-11CF-A4B0-00AA004A55E8}</LanguageCLSID><ControlCLSID>{00000000-0000-0000-0000-000000000000}</ControlCLSID><ControlObjWidth>64</ControlObjWidth><ControlObjHeight>64</ControlObjHeight><RunState>1</RunState><ManualControlLoad>0</ManualControlLoad><ScriptHostVersion>2</ScriptHostVersion></Object></Globals></DXScript>
  76.